package com.novabluetooth.services;

import java.util.Arrays;

import android.text.TextUtils;
/**
 * 蓝牙相关工具类
 * @author nova
 *
 */
public class BluetoothConstant {
	
	public final static String REGISTER_GB="com.example.communication.RECEIVER2";
	public final static String REGISTER_EW="com.example.communication.REGISTER_EW";
	public final static String REGISTER_Waiting="com.example.communication.REGISTER_Waiting";
	// 华清心电----------
	public final static String ECG_PATH_XML = "/ECGDATA/XML/";
	public final static String ECG_PATH_JPEG = "/ECGDATA/JPEG/";
	public final static String TIWEN_HTD2="NOVAEW";
	/**
	 * 心电
	 */
	public final static String ECG="ECG";
	public final static String ECG_TYPENAME="心电";
	/**
	 * 体重
	 */
	public final static String TIZHONG="TIZHONG";
	public final static String TIZHONG_TYPENAME="体重";
	/**
	 *血氧
	 */
	public final static String XUEYANG="XUEYANG";
	public final static String XUEYANG_TYPENAME="血氧";
	/**
	 * 血糖
	 */
	public final static String XUETANG="XUETANG";
	public final static String XUETANG_TYPENAME="血糖";
	/**
	 * 血压
	 */
	public final static String XUEYA="XUEYA";
	public final static String XUEYA_TYPENAME="血压";
	/**
	 * 体温
	 */
	public final static String TIWEN="TIWEN";
	public final static String TIWEN_TYPENAME="体温";
	
	/**
	 * 尿常规
	 */
	public final static String NIAOCHANGGUI="NIAOCHANGGUI";
	public final static String NIAOCHANGGUI_TYPENAME="尿常规";
	
	
	
	/**
	 * 耳温
	 */
	public final static String TIWEN_EWQ_NOVA = "NOVATF_LE";
	public final static String TIWEN_EWQ_HTD = "HTD02";// HTD02和泰达耳温枪，HC-08和泰达额温枪
	public final static String TIWEN_EWENQ_HTD = "HC-08";
	public final static String TIWEN_EWENQ_HTD2 = "NOVAEW";
	
	/**
	 * 血糖
	 */
	//三诺(安稳型)血糖仪
	public final static String XUETANG_AMX_SANNUO = "NOVABG_LE";
	//三诺（WL-1型）血糖仪
	public final static String XUETANG_WL_1_SANNUO = "Sinocare";
	
	// 鱼跃760血糖仪(怡成血糖仪通信协议相同)
    public final static String XUETANG_YUYUE760_YUYUE = "Yuwell Glucose";
    //微泰医疗血糖仪
	public final static String XUETANG_WEITAI="GoChek";
		
		
	 /**
	  * 血氧
	  */
	//贝瑞血氧
	public final static String  XUEYANG_BM = "BerryMed";
	//黑色诺安血氧
	public final static String  XUEYANG_NOVA = "NOVABT_LE";
	//科瑞康(力康)血氧
	public final static String  XUEYANG_LIKANG_KRK = "POD";
	
	
	
	/**
	 * 体重
	 */
	//诺安体重
	public final static String TIZHONG_NOVA = "NOVABW_LE";
	/**
	 * 血压计
	 */
	//康泰O8A血压计
	public static final String XUEYA_CONTEC08A_KTXYJ = "NIBP010095";
	public static final String XUEYA_CONTEC08A1_KTXYJ = "NIBP031217";
	public final static String XUEYA_KANGTAI = "CONTEC BloodPressure";

	//捷美瑞血压计
	public final static String XUEYA_JMR = "BPM-188";
	public final static String XUEYA_JMR2 = "H.HOME BP";
	
	// 鱼跃血压计（YE680A）
	 public final static String XUEYA_YE680A_YUYUE = "Yuwell BloodPressure";
	// 优瑞恩血压计
	 public final static String  XUEYA_YOURIEN = "Bluetooth BP";

	// 脉搏波血压计1
	public final static String XUEYA_MAIBOBO1 = "RBP";
	// 脉搏波血压计2
	public final static String XUEYA_MAIBOBO2 = "BP";
	 /**
	 * 血红蛋白
	 */
	//血红蛋白--易捷
	public final static String  XUEHONGDANBAI_NOVA= "NOVAHB1_LE";
	
	/**
	 * 尿液分析仪
	 */
	//汉唐尿液分析仪HT-111A
	public final static String NIAOJI_HT111A_HANTANG = "NOVAUR_LE";
	//康泰尿机
	public final static String NIAOJI_KANGTAINIAOJI = "BC014062";
	public final static String NIAOJI_KANGTAINIAOJI2 = "BC014244";
	
	
	
	
	public static final String CMS50EW = "CMS50EW";
	public static final String CMS50EW1 = "SpO201";
	
	public static final Object DEVICE_NAME1 = XUEYA_CONTEC08A_KTXYJ;
	public static final Object DEVICE_NAME2 = XUEYA_CONTEC08A1_KTXYJ;

	/**
	 * 获取设备测量类型
	 * 
	 */
	public static String getCLTypeName(String queryIndex) {
		if (TextUtils.isEmpty(queryIndex)) {
			return "";
		}
		String typename = "";
		switch (queryIndex) {
		case BluetoothConstant.TIZHONG:
			typename = BluetoothConstant.TIZHONG_TYPENAME;
			break;
		case BluetoothConstant.TIWEN:
			typename = BluetoothConstant.TIWEN_TYPENAME;
			break;
		case BluetoothConstant.XUEYANG:
			typename = BluetoothConstant.XUEYANG_TYPENAME;
			break;
		case BluetoothConstant.XUEYA:
			typename = BluetoothConstant.XUEYA_TYPENAME;
			break;
		case BluetoothConstant.XUETANG:
			typename = BluetoothConstant.XUETANG_TYPENAME;
			break;
		case BluetoothConstant.NIAOCHANGGUI:
			typename = BluetoothConstant.NIAOCHANGGUI_TYPENAME;
			break;
		case BluetoothConstant.ECG:
			typename = BluetoothConstant.ECG_TYPENAME;
			break;
		}
		return typename;
	}

	/**
	 * 获取设备名
	 * @param name
	 * @return
	 * @author 王婷婷
	 * @date 2017年7月13日 下午3:43:39
	 */
	public  static String getNovaDevice(String name) {
		String[] novaDevices = { BluetoothConstant.TIWEN_EWQ_NOVA, BluetoothConstant.TIWEN_EWENQ_HTD,
				BluetoothConstant.TIWEN_EWQ_HTD, BluetoothConstant.TIZHONG_NOVA,

				BluetoothConstant.XUETANG_AMX_SANNUO, BluetoothConstant.XUETANG_WL_1_SANNUO,
				BluetoothConstant.XUETANG_YUYUE760_YUYUE,

				BluetoothConstant.XUEYANG_NOVA, BluetoothConstant.XUEYANG_BM, BluetoothConstant.XUEYANG_LIKANG_KRK,

				BluetoothConstant.XUEYA_JMR, BluetoothConstant.XUEYA_JMR2, BluetoothConstant.XUEYA_KANGTAI,
				BluetoothConstant.XUEYA_YOURIEN, BluetoothConstant.XUEYA_YE680A_YUYUE,

				BluetoothConstant.NIAOJI_HT111A_HANTANG, BluetoothConstant.NIAOJI_KANGTAINIAOJI,
				BluetoothConstant.NIAOJI_KANGTAINIAOJI2,

				BluetoothConstant.XUEHONGDANBAI_NOVA, };
		int indexOf = Arrays.asList(novaDevices).indexOf(name);
		String novaName = "";
		switch (indexOf) {

		case -1:
			if (name.contains("NIBP03") || name.equals(BluetoothConstant.DEVICE_NAME2)) {
				novaName = "康泰血压计08A-BT";
				break;
			}
			if (name.startsWith("SS-")) {
				novaName = "神思身份证读卡器";
				break;
			}
			if (name.startsWith("KT8000_")) {
				novaName = "卡尔身份证读卡器";
				break;
			}
			if (name.contains("RBP") || name.contains("BP")) {
				novaName = "脉搏波血压计";
				break;
			}
			if(name.startsWith(BluetoothConstant.XUETANG_WEITAI)){
				novaName = "微泰血糖仪";
				break;
			}
			if(name.contains("ID300")){
				novaName = "脉搏波血压计";
				break;
			}
			break;
		case 0:
			novaName = "诺安耳温枪";
			break;
		case 1:
			novaName = "和泰达额温枪";
			break;
		case 2:
			novaName = "和泰达耳温枪";
			break;
		case 3:
			novaName = "诺安体重";
			break;
		case 4:
			novaName = "三诺安稳型血糖仪";
			break;
		case 5:
			novaName = "三诺WL-1型血糖仪";
			break;
		case 6:
			novaName = "鱼跃760血糖仪";
			break;
		case 7:
			novaName = "诺安血氧";
			break;
		case 8:
			novaName = "贝瑞血氧";
			break;
		case 9:
			novaName = "科瑞康血氧";
			break;
		case 10:
			novaName = "捷美瑞血压计";
			break;
		case 11:
			novaName = "捷美瑞血压计";
			break;
		case 12:
			novaName = "康泰08A血压计";
			break;
		case 13:
			novaName = "优瑞恩血压计";

			break;
		case 14:
			novaName = "鱼跃血压计YE680A";
			break;
		case 15:
			novaName = "诺安尿液分析仪";

			break;
		case 16:
			novaName = "康泰尿液分析仪BC401BT";
			break;
		case 17:
			novaName = "康泰尿液分析仪BC401BT";
			break;
		case 18:
			novaName = "诺安血红蛋白分析仪";
			break;
		default:
			novaName = "";
			break;
		}
		return novaName;
	}

}
